import {Routes, Route} from 'react-router-dom'
import React from 'react'

const Home = React.lazy(() => import('@/pages/home'))
const Note = React.lazy(() => import('@/pages/note'))
const Child = React.lazy(() => import('@/pages/home/components/child'))

const RoutesComponents = () => {

  return (
    <Routes>
      <Route path="home" element={<Home />}>
        <Route path="" element={<Child />} />
        <Route path="child" element={<Child />} />
      </Route>
      <Route path="note/*" element={<Note />} /> 
      
      {/* 无匹配路由 放置在最后一个路由的位置 */}
      <Route path="*" element={<Home />} /> 
    </Routes>
  )
}

export default RoutesComponents